﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<PorteringManagement.Model.Itinerary>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Itinerarios
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Detalle de Itinerarios</h2>

<fieldset>
    <legend>Itinerario</legend>

    <div class="display-label">Identificador Puerto de Partida</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.DeparturePortID) %>
    </div>
    
    <div class="display-label">Fecha de Partida</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.DepartureTime) %>
    </div>

    <div class="display-label">Identificador Puerto de Llegada</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.ArrivalPortID) %>
    </div>
    
    <div class="display-label">Fecha de LLegada</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.ArrivalTime) %>
    </div>

    <div class="display-label">Nombre</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.Name) %>
    </div>

    <div class="display-label">Descripción</div>
    <div class="display-field">
        <%: Html.DisplayFor(model => model.Descripion) %>
    </div>
    <br />
    <table>
        <tr>
            <th>
                Puerto de Partida
            </th>
<%--
            <th>
                Fecha de Partida
            </th>
--%>
            <th>
                Puerto de LLegada
            </th>
<%--
            <th>
                Fecha de Llegada
            </th>
--%>
        </tr>

        <% foreach (var journey in this.Model.Journeys) { %>
        <tr>
            <td>
                <%= string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} ({1})", journey.DeparturePort.Name, journey.DeparturePortID) %>
            </td>
<%--
            <td>
                <%= journey.DepartureTime.HasValue ? journey.DepartureTime.Value.ToString() : string.Empty %>
            </td>
--%>
            <td>
                <%= string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} ({1})", journey.ArrivalPort.Name, journey.ArrivalPortID) %>
            </td>
<%--
            <td>
                <%= journey.ArrivalTime.HasValue ? journey.ArrivalTime.Value.ToString() : string.Empty %>
            </td>
--%>
        </tr>
        <% } %>
    </table>

</fieldset>
<p>
    <%: Html.ActionLink("Volver a la Lista", "Index") %>
</p>

</asp:Content>
